package com.hycat.mail.order.init;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hycat.mail.order.entity.OrderAccount;
import com.hycat.mail.order.service.OrderAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;

/**
 * @author : lzhycat
 * @date : 2022-08-22 17:53
 */
public class OrderInit implements CommandLineRunner {

    @Autowired
    private OrderAccountService orderAccountService;

    @Override
    public void run(String... args) throws Exception {
        initOrderAccount();
    }

    public void initOrderAccount() {
        orderAccountService.remove(new QueryWrapper<OrderAccount>().eq("lock", "lock"));
    }
}
